/* 全局样式 */
:root {
  --primary-color: #3498db;
  --secondary-color: #2ecc71;
  --accent-color: #e74c3c;
  --light-bg: #f8f9fa;
  --dark-bg: #343a40;
  --text-color: #333;
  --light-text: #f8f9fa;
  --sidebar-width: 280px;
}

body {
  font-family: 'Nunito', 'Microsoft YaHei', sans-serif;
  color: var(--text-color);
  background-color: #f5f7fa;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

body.loaded {
  opacity: 1;
}

/* 页面过渡效果 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* 侧边栏样式 */
.sidebar {
  background: linear-gradient(180deg, var(--primary-color), #2980b9);
}

.sidebar-menu-item:hover {
  transform: translateX(5px);
}

.sidebar-menu-item.active {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar-menu-item .badge {
  float: right;
  margin-top: 2px;
}

.content-wrapper {
  background-color: #f8f9fa;
}

/* 卡片样式 */
.card {
  border: none;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  background-color: white;
}

.card:hover {
  transform: translateY(-7px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color), #2980b9);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem 1.25rem;
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* 搜索框样式 */
.search-box {
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border-radius: 30px;
  overflow: hidden;
}

.search-box .form-control {
  border-radius: 30px;
  padding-left: 50px;
  height: 50px;
  border: none;
}

.search-box .search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
}

/* 筛选卡片折叠效果 */
.filter-card {
  overflow: hidden;
  transition: max-height 0.5s ease;
  max-height: 500px;
}

.filter-collapsed {
  max-height: 60px;
}

/* 按钮样式 */
.btn {
  border-radius: 5px;
  font-weight: 600;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%);
  transform-origin: 50% 50%;
}

.btn:hover::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    transform: scale(40, 40);
    opacity: 0;
  }
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #2980b9);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #2980b9, var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary-color), #27ae60);
  border-color: var(--secondary-color);
}

.btn-success:hover {
  background: linear-gradient(135deg, #27ae60, var(--secondary-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--accent-color), #c0392b);
  border-color: var(--accent-color);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #c0392b, var(--accent-color));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* 徽章样式 */
.badge {
  padding: 0.5em 0.8em;
  font-weight: 600;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.badge.bg-danger {
  background: linear-gradient(135deg, var(--accent-color), #c0392b) !important;
}

.badge.bg-success {
  background: linear-gradient(135deg, var(--secondary-color), #27ae60) !important;
}

/* 表单控件 */
.form-control, .form-select {
  border-radius: 5px;
  border: 1px solid #ddd;
  padding: 0.6rem 1rem;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  transition: all 0.3s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
  transform: translateY(-2px);
}

.invalid-feedback-active .form-control:invalid,
.invalid-feedback-active .form-select:invalid {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 0.25rem rgba(231, 76, 60, 0.25);
}

.shake-animation {
  animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* 物品列表项动画效果 */
.col {
  transition: all 0.3s;
  animation: fadeIn 0.5s ease-in-out backwards;
}

.col:nth-child(3n+1) { animation-delay: 0.1s; }
.col:nth-child(3n+2) { animation-delay: 0.2s; }
.col:nth-child(3n+3) { animation-delay: 0.3s; }

/* 图片相关样式 */
.card-img-container {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.item-image {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

/* 详情页图片 */
.detail-image {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  max-height: 400px;
  object-fit: contain;
}

.detail-image:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 图片预览模态框 */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.preview-image {
  max-width: 90%;
  max-height: 90%;
  border-radius: 5px;
}

.close-modal-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.3s;
}

.close-modal-btn:hover {
  transform: rotate(90deg);
}

/* 页脚样式 */
footer {
  background-color: var(--light-bg);
  padding: 1.5rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  margin-top: 3rem;
}

/* 表格样式 */
.table-borderless th {
  font-weight: 600;
  color: #555;
}

.table-borderless td {
  padding: 0.75rem 0.5rem;
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 80px;
  height: 80px;
  position: relative;
}

.loading-spinner:after {
  content: " ";
  display: block;
  width: 64px;
  height: 64px;
  margin: 8px;
  border-radius: 50%;
  border: 6px solid var(--primary-color);
  border-color: var(--primary-color) transparent var(--primary-color) transparent;
  animation: loading-spinner 1.2s linear infinite;
}

@keyframes loading-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .card-title {
    font-size: 1.1rem;
  }
  
  .detail-image {
    max-height: 300px;
  }
}

@media (max-width: 992px) {
  .content-wrapper {
    padding-left: 15px;
    padding-right: 15px;
  }
} 